package com.boc.webmodule.activity;

import android.view.View;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.boc.webmodule.R;
import com.tencent.smtt.sdk.WebView;

import demo.bocweb.com.sdk.config.ARoutConfig;
import demo.bocweb.com.sdk.util.PhotoPickerHelper;
import demo.bocweb.com.sdk.util.ToolbarHelper;

/**
 * Created by zhelun on 2018/2/6.
 */
@Route(path = ARoutConfig.demoWebViewPath)
public class DemoWebView extends BaseWebActivity {

    @Override
    protected void loadUrl() {
        ToolbarHelper.init(this, "WebView测试", R.mipmap.ic_back, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (web.canGoBack()) {
                    web.goBack();
                } else {
                    onBackPressed();
                }
            }
        });
        web.loadUrl("https://github.com/LuckSiege/PictureSelector");
    }

    @Override
    protected void selectMultiPhoto() {
        PhotoPickerHelper.selectMultiPhoto(this, REQUEST_CODE, 9);
    }

    @Override
    public void overrideUrl(WebView view, String url) {
        web.loadUrl(url);

    }
}
